package com.imooc.trading_system.enums;

import lombok.Getter;

/**
 * @author Feng zhaoxi
 * @date 2022/4/23 4:14 下午
 * @Description
 */
public enum BizCodeEnum {
    /**
     * 用户
     */
    USER_DOES_NOT_EXIST(200001, "用户不存在,请先注册"),
    ACCOUNT_REPEAT(200002, "存在相同的用户名"),
    ACCOUNT_NOT_LOGIN(200003, "账号未登录"),
    EDIT_USER_FAILED(200004, "修改用户失败"),
    NO_CORRESPONDING_USER(200005, "没有对应的用户"),
    ACCOUNT_PWD_ERROR(200006, "用户名或密码错误"),
    UPLOAD_HEAD_IMG_FAILED(200007, "上传头像失败"),
    DO_NOT_OPEN_WALLET(200008, "未开启钱包"),
    HAD_OPEN_WALLET(200009, "钱包已开启，无需再次开启"),
    CLOSE_WALLET_FAILED(200010, "账户余额不为0，无法关闭钱包，请先提现"),
    INVITATION_CODE_ERROR(20011, "邀请码错误，请联系qq群管理员"),
    /**
     * 地址
     */
    NO_CORRESPONDING_ADDRESS(210001, "没有对应的地址"),
    EDIT_ADDRESS_FAILED(210002, "修改地址失败"),
    DELETE_ADDRESS_FAILED(210003, "删除地址失败"),
    MUST_HAVE_A_DEFAULT_ADDRESS(210004, "必须要有一个默认地址"),
    /**
     * 产品
     */
    PUBLISH_PRODUCT_FAILED(220001, "发布产品失败"),
    GET_PRODUCT_FAILED(220002, "获取产品详情失败，没有对应的产品"),
    /**
     * 订单
     */
    ORDER_OFFLINE(230001, "订单已下线，请选择其他商品"),
    STOCK_NOT_ENOUGH(230002, "没有足够的库存"),
    CREATE_ORDER_FAILED(230003, "下单失败"),
    CAN_NOT_BUY_SELF(230004, "不能下单自己发布的商品"),
    BALANCE_NOT_ENOUGH(230005, "余额不足"),
    DEDUCTIONS_FAILED(230006, "扣款失败"),
    NO_ORDER(230007, "没有对应的订单")


//    PLEASE_CONNECT_ADMIN_SET_PERMISSION(230001, "请联系管理员设置权限"),
//    ACCOUNT_DISABLE(230002, "您的账户已被禁用，请联系管理员"),
//    DING_ERROR(230003, "钉钉扫码失败"),
//    NO_CORRESPONDING_USER(230007, "没有对应的用户"),
//    DELETE_USER_FAILED(230008, "删除用户失败"),
//    ACCOUNT_UNREGISTER(250002,"账号不存在"),
//    ACCOUNT_PWD_ERROR(250003,"账号或者密码错误"),
//    ACCOUNT_UNLOGIN(250004,"账号未登录"),


    ;
    @Getter
    private final String msg;

    @Getter
    private final int code;

    private BizCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
